import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
//引入国际化
import i18n  from '@/i18n/index.ts' 

// import "@/mock/index"

// 使用循环注册的方式
import * as directives from './directives'
// 引入ts文件对应的全局注册的组件的配置
import components from '@/plugins/global-components';
// 引入插件并安装
import { addGlobalPropertiesPlugin } from '@/plugins/globalProperties'
//引入字体图标
import "@/assets/fonts/index.less";
//引入图标
import 'virtual:svg-icons-register';
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
const  pinia=createPinia();
const app = createApp(App)
pinia.use(piniaPluginPersistedstate);

// 开始遍历注册-自定义指令
Object.keys(directives).forEach(key => {
  app.directive(key, directives[key])
})

app.use(components);
app.use(pinia)
app.use(router)
app.use(addGlobalPropertiesPlugin);
app.use(i18n);
app.mount('#app')
